Course Correction is the opening sequence of a text-based role-playing experience with branching narrative and dialogue choices.
<hr>
You are in a stark antechamber, crowded between a score of men, all wearing identical jumpsuits the colour of rust.
"Inmates, listen up!" a testy voice barks. "Keep your feet still and your hands to yourselves. The warden will be along soon."
"Yeesh, that guy sounds like he resents being here more than we do."
Stifling a chuckle, you turn to your left, toward the man who had spoken in a hushed whisper. His angular eyes wink, wrinkling the skin on his playful nose.
"Name's Silas," he nods at you. "What's yours?"
<<textbox "$player_name" "" "The Christening">>
<script>$('#textbox-player-name').attr('placeholder','Enter name');</script><<silently>>
<<set $silasAffinity = 0>>
<<set $player_name = $player_name.toLowerCase()>>
<<set $player_name = $player_name.toUpperFirst()>>
<</silently>>\
"Hello, $player_name. What's a nice guy like you doing in a place like this?"
<div id = "choice-link"><span class = "blink">• </span><<linkappend "//Well, I was in the wrong place at the wrong time.//">>
<<replace #christening-replace t8n>>\
<<include "Right Time, Silas">>\
<</replace>><<remove #choice-link t8n>>
<</linkappend>>\
</div>\
<span id = "christening-replace"></span>
<script>$('.link-internal.macro-linkappend').attr('title','*laughs uncomfortably*');</script>\Please say yes.
<<textbox "$say_yes" "" "Yes or no">>
<script>$('#textbox-say-yes').attr('placeholder','lolzo');</script><<if $say_yes is "yes" or $say_yes is "Yes" or $say_yes is "yes." or $say_yes is "Yes." or $say_yes is "YES" or $say_yes is "YES.">>\
Thank you.
<<elseif $say_yes is "no" or $say_yes is "No" or $say_yes is "no." or $say_yes is "No." or $say_yes is "NO" or $say_yes is "NO.">>\
You just had to say no, didn't you?
<<else>>\
[[Please enter a valid response|say yes]].
<<endif>>\Multiple choices in the same passage that disappear when choice is made.
<div id = "replace-me"><<linkappend "Rofl">>
<<replace #replace-me t8n>>Rofl<</replace>>
<<replace #below t8n>>Rolling on the floor laughing<</replace>><</linkappend>>
<<linkappend "Lmao">>
<<replace #replace-me t8n>>Lmao<</replace>>
<<replace #below t8n>>Laughing my ass out<</replace>><</linkappend>></div>
<span id = "below"></span>''<span style = "color:mediumseagreen; font-size:135%; font-family:garamond;">To set sentence casing for a string</span>''
<<if $temp_str === undefined>><<set $temp_str = "viNdiCaTe">><<endif>>\
$temp_str
<<silently>><<set $temp_str = $temp_str.toLowerCase()>><<set $temp_str = $temp_str.toUpperFirst()>><</silently>>\
$temp_str
''<span style = "color:mediumseagreen; font-size:135%; font-family:garamond;">To set placeholder for a textbox macro</span>''
<<textbox "$temp_str" "" "Code to achieve specific things">>
<script>$('#textbox-temp-str').attr('placeholder','This is a placeholder');</script>\
''<span style = "color:mediumseagreen; font-size:135%; font-family:garamond;">To set title for popup on hover</span>''
<<linkappend "Hover over me.">><<replace #neat t8n>>This is pretty neat, huh?
<</replace>><</linkappend>>
<span id="neat"></span><script>$('.link-internal.macro-linkappend').attr('title','This is a one time-use link.');</script>\
''<span style = "color:mediumseagreen; font-size:135%; font-family:garamond;">To make content blink</span>''
Add content inside a span or a div, or whatever, with the class blink, and the <span class = "blink">contents will blink</span>. Cool, right? The functionality is in the story's custom stylesheet.<<set $seconds to 10>>\
Countdown: <span id="countdown">$seconds seconds remaining</span>!\
<<silently>>
<<repeat 1s>>
<<set $seconds to $seconds - 1>>
<<if $seconds gt 0>>
<<replace "#countdown">>$seconds seconds remaining<</replace>>
<<else>>
<<replace "#countdown">>Too Late<</replace>>
/* do something useful here */
<<stop>>
<</if>>
<</repeat>>
<</silently>><<set _tmpPassageName = passage()>>\
<div id = "header-center">\
<span class = "header-left"><<if _tmpPassageName !== "Orientation">><<back "←">><<endif>></span>\
<span class = "header-right"><<print passage()>></span>\
</div>\
<br><br>
<div id = "footer-border"><span id = "footer-left"><<print Story.title>></span>\
<span id = "footer-right">[[↻ Restart|Orientation][state.restart()]]</span></div><div id = "chosen-dialogue">Shh!</div>\
"Did you just shush me? I thought I took the prison bus, not the school bus."
<<include "Warden Sharp">><div id = "chosen-dialogue">Haha.</div>\
"Oof, straight to the gut with that pity laugh."
<<include "Warden Sharp">>Fully extricated from his coat, the important man addresses the crowd.
"You're here, all of you, because you made some bad choices. Decisions I'm sure you wish you could take back. Sadly, you cannot. Instead, what you get is a chance to reflect. A chance to atone," the important man says. He has an air of rehearsal about him, no doubt a result of having given the same speech a dozen times over.
"My name is Warden Sharp. Once my officers have shown you lot to your cells, I will start meeting with every one of you. Over the next few days, we'll be making comprehensive plans for your rehabilitation, to make the best use of your days in this correctional facility."
Silas makes an exaggerated shuddering motion, with a gagging noise to go with it.
Warden Sharp drones on. "...my office is always open. If you have a problem with any of my officers, you come straight to me. It is very important to me that you're not treated as less than. Some of my best efforts have gone into making sure that you are not dehumanised in your time here. When it comes..."
<div id = "choice-link">
[[Continue listening to the warden.|Two-shoes]]
[[Whisper to Silas.|Psst. Hey.]]\
</div>\"...to discipline, I do not tolerate blunders - there's nothing accidental about falling out of line. Propriety is everything. And you would do well to keep that in mind. For now, you'll be taken to processing. We'll talk again soon."
<div id = "choice-link">[[A Proper Introduction]]</div><<set $silasAffinity += 1>>\
<div id = "choice-link">\
<<linkappend "//How many times do you think the big man practised this in front of a mirror?//">>
<<replace #fight-power-replace t8n>>\
<<include "A Little Fire">>
<</replace>>\
<<remove #choice-link t8n>>\
<</linkappend>>
<<linkappend "//Have you always been this mutinous?//">>
<<replace #fight-power-replace t8n>>\
<<include "Mutinous">>\
<</replace>>\
<<remove #choice-link t8n>>\
<</linkappend>>
</div>\
<div id = "fight-power-replace"></div><div id = "chosen-dialogue">How many times do you think the big man practised this in front of a mirror?</div>\
"Hey, look at that! He's got a little fire in him."
<div id = "choice-link"><<linkappend "Shrug.">>
<<replace #abc t8n>>\
<<include "Fight the Power">>\
<</replace>>\
<<remove #choice-link t8n>>\
<</linkappend>>\
</div>\
<span id = "abc"></span><div id = "chosen-dialogue">Have you always been this mutinous?</div>\
"Oh, not at all. I followed every rule, never broke a single one. That's why I'm here, actually."
<div id = "choice-link"><<linkappend "//I'm sure being a wiseass had nothing to do with it.//">>
<<replace #mutinous-replace t8n>>\
<<include "The Bark and the Bite">>\
<</replace>><<remove #choice-link t8n>>
<</linkappend>>\
</div>\
<span id = "mutinous-replace"></span><div id = "chosen-dialogue">Well, I was in the wrong place at the wrong time.</div>\
"Hah! I doubt there's ever a right time to be here."
A man oozing importance strides in, eyes scanning the gathered men even as he shrugs out of his coat.
"Fancy man, fancy suit," Silas breathes.
<div id = "choice-link"><em>[[Shh!|Straight Outta Kindergarten]]
[[Haha.|An Awkward Exchange]]</em></div><div id = "chosen-dialogue">I'm sure being a wiseass had nothing to do with it.</div>\
"He barks, //and// he bites. Never woulda guessed."
<div id = "choice-link"><<linkappend "//Last I checked, you didn't have the monopoly on being snide.//">>
<<set $silasAffinity += 1>>\
<<replace #bark-bite-replace t8n>>\
<div id = "chosen-dialogue">Last I checked, you didn't have the monopoly on being snide.</div>\
"Can't say that I do. But speaking of monopolies, this guy sure seems to have one on monologues. Do you think he'll ever stop?"
<div id = "choice-link">[[Turn back to the warden.|A Proper Introduction]]</div>\
<</replace>>\
<<remove #choice-link t8n>>\
<</linkappend>>\
</div>\
<span id = "bark-bite-replace"></span><div id = "chosen-dialogue">Sounds about right to me.</div>\
"Ah, the days when you could simply get up and walk out if you didn't like a lecture."
<div id = "choice-link"><<linkappend "//So, you went to college?//">>
<<replace #walk-out-replace t8n>>\
<div id = "chosen-dialogue">So, you went to college?</div>\
"Mighty judgemental for someone who's in the same fucking boat. Hold up, looks like the warden's just about done."
<div id = "choice-link">[[Turn back to the warden.|A Proper Introduction]]</div>\
<</replace>>\
<<remove #choice-link t8n>>\
<</linkappend>>\
</div>\
<span id = "walk-out-replace"></span>"I'll leave you men to settle in, meet your cellmates, and think about what you want to achieve here. Good luck," the warden finishes and walks away, as guards swarm in to usher the group deeper into the premises.<div class = "credits">\
<p>A story by Amruth Varshan
Thanks to Chris Klimas, for making Twine.
Another line.</p>\
</div>\<div id = "performed-action">You shrug.</div>\
"My expert opinion, and I could be wrong here, is: approximately eighty-seven times."
<div id = "choice-link"><<linkappend "//Sounds about right to me.//">>
<<replace #little-fire-replace t8n>>\
<<include "Walk Out">>\
<</replace>>\
<<remove #choice-link t8n>>\
<</linkappend>>\
</div>\
<span id = "little-fire-replace"></span>